const express = require('express')
const app = express()
const port = 3000
const bodyParser = require('body-parser')



const router = require('./router/index')

app.use(bodyParser.urlencoded({ extended: false }))

app.use(bodyParser.json())


app.use('/', router)

app.use(function (err, req, res, next) {
    console.error(err.stack);
    res.send(500, 'Something broke!');
});

app.listen(port, () => {
    console.log(`Example app listening at http://localhost:${port}`)
})